import React, { Component, Fragment } from 'react';
import styles from './OrderItem.module.less'
// 订单的每一项
class OrderItem extends Component {
  constructor(props) {
    super(props)
    this.state = {}
  }
  render() {
    let { orderList } = this.props;
    return (
      <Fragment>
        {
          orderList.map(item => {
            return (
              <div key={item.id} className={styles.orderItem}>
                <div className={styles.imgWrap}>
                  <img src={item.img} alt="冰淇淋"></img>
                </div>
                <div className={styles.nameWrap}>
                  <p>{item.goodName}</p>
                  <div>
                    <span style={{ color: '#ababab' }}>x{item.num}</span>
                    <span style={{ color: '#f59aa7' }}>¥{item.price}</span>
                  </div>
                </div>
              </div>
            )
          })
        }
      </Fragment>
    )
  }
}

export default OrderItem;
